package view;

import java.util.ArrayList;
import java.util.List;

import model.Model;
import controller.Controller;

public abstract class View {
	
	private List<Controller> controllers;
	
	public View() {
		controllers = new ArrayList<Controller>();
	}
	
	public abstract void update(Model m);
	
	public void register( Controller controller ) {
		controllers.add( controller );
	} 
	
	public void unRegister( Controller controller ) {
		controllers.remove( controller );
	}
	
	protected void updateSubscribers() {
		for( Controller c : controllers ) {
			c.update( this );
		}
	}
	
}
